#encoding=utf-8
#!/usr/bin/python


import os, sys, string,time,datetime
import mod_stage 
import cgi
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template



pro_conf_obj = mod_stage.pro_conf()
pro_conf_dict = pro_conf_obj.get_all()
pro_name =pro_conf_dict['pro_name']


class MainPage(webapp.RequestHandler): 
  def get(self): 
    page_str = ''
 
    template_values = { 
      'title': pro_name,
      'greetings': [{'author':'jack','content':'xixi'},{'author':'ug','content':'cax'}], 
      'url': '#', 
      'url_linktext': 'woshiug', 
      } 
 
    path = os.path.join(os.path.dirname(__file__)+'/views', 'index.html') 
    page_str += template.render(path, template_values)
    self.response.out.write(page_str)


def main():
    #路由
    application = webapp.WSGIApplication([
    ('/', MainPage),
    ('/list', MainPage),
    ('/add', MainPage),
    ('/.*', MainPage),
    ],
    debug=True)
                                       
    wsgiref.handlers.CGIHandler().run(application)



if __name__ == "__main__":
    main()






print "<br/>" ,time.time(),"<br/>";



